package com.ucode.model.cgms.form;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Schema(description = "陪玩俱乐部社区系统 - 添加联合服务人员Form")
@Data
@EqualsAndHashCode
@ToString(callSuper = true)
public class CgmsJointServiceUserAddForm {

    @Schema(description = "订单ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @Schema(description = "服务人员列表", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "服务人员列表不能为空")
    private List<@Valid JointServiceUserItem> items;

    @Schema(description = "服务人员")
    @Data
    public class JointServiceUserItem  {

        @Schema(description = "服务人员ID", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "服务人员ID不能为空")
        private Long serviceUserId;

        @Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "金额不能为空")
        @DecimalMin(value = "0",message = "金额最小值为 0")
        private BigDecimal amount;

    }
}
